package design.factory;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/10
 * Time: 11:09
 */
public class FactoryPatternDemo {

    public static void main(String[] args) {

        ShapeFactory factory = new ShapeFactory();

        Shape shap = factory.getShap("circle");
        shap.draw();

        shap = factory.getShap("rectangle");
        shap.draw();

        shap = factory.getShap("square");
        shap.draw();

        shap = factory.getShap("123");
        shap.draw();
    }
}
